// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package com.ec.service;

public final class ProductServicePrxHelper extends Ice.ObjectPrxHelperBase implements ProductServicePrx
{
    public boolean
    addDirectory(int parentid, float tax, String dirName)
    {
        return addDirectory(parentid, tax, dirName, null, false);
    }

    public boolean
    addDirectory(int parentid, float tax, String dirName, java.util.Map<String, String> __ctx)
    {
        return addDirectory(parentid, tax, dirName, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private boolean
    addDirectory(int parentid, float tax, String dirName, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("addDirectory");
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                return __del.addDirectory(parentid, tax, dirName, __ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public DateTime
    getCurrentDate()
    {
        return getCurrentDate(null, false);
    }

    public DateTime
    getCurrentDate(java.util.Map<String, String> __ctx)
    {
        return getCurrentDate(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private DateTime
    getCurrentDate(java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("getCurrentDate");
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                return __del.getCurrentDate(__ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public DateTime[]
    getTimes()
    {
        return getTimes(null, false);
    }

    public DateTime[]
    getTimes(java.util.Map<String, String> __ctx)
    {
        return getTimes(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private DateTime[]
    getTimes(java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("getTimes");
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                return __del.getTimes(__ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public void
    printCurrentDate(DateTime currentDate)
    {
        printCurrentDate(currentDate, null, false);
    }

    public void
    printCurrentDate(DateTime currentDate, java.util.Map<String, String> __ctx)
    {
        printCurrentDate(currentDate, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    printCurrentDate(DateTime currentDate, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                __del.printCurrentDate(currentDate, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public void
    printString(String s)
    {
        printString(s, null, false);
    }

    public void
    printString(String s, java.util.Map<String, String> __ctx)
    {
        printString(s, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    printString(String s, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                __del.printString(s, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public String[]
    queryBySql(String sql)
    {
        return queryBySql(sql, null, false);
    }

    public String[]
    queryBySql(String sql, java.util.Map<String, String> __ctx)
    {
        return queryBySql(sql, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private String[]
    queryBySql(String sql, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("queryBySql");
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                return __del.queryBySql(sql, __ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public String[]
    queryBySqlNotType(String sql)
    {
        return queryBySqlNotType(sql, null, false);
    }

    public String[]
    queryBySqlNotType(String sql, java.util.Map<String, String> __ctx)
    {
        return queryBySqlNotType(sql, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private String[]
    queryBySqlNotType(String sql, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("queryBySqlNotType");
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                return __del.queryBySqlNotType(sql, __ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public boolean
    updateDirectory(int id, String dirName, float tax)
    {
        return updateDirectory(id, dirName, tax, null, false);
    }

    public boolean
    updateDirectory(int id, String dirName, float tax, java.util.Map<String, String> __ctx)
    {
        return updateDirectory(id, dirName, tax, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private boolean
    updateDirectory(int id, String dirName, float tax, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("updateDirectory");
                __delBase = __getDelegate(false);
                _ProductServiceDel __del = (_ProductServiceDel)__delBase;
                return __del.updateDirectory(id, dirName, tax, __ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public static ProductServicePrx
    checkedCast(Ice.ObjectPrx __obj)
    {
        ProductServicePrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (ProductServicePrx)__obj;
            }
            catch(ClassCastException ex)
            {
                if(__obj.ice_isA("::com::ec::service::ProductService"))
                {
                    ProductServicePrxHelper __h = new ProductServicePrxHelper();
                    __h.__copyFrom(__obj);
                    __d = __h;
                }
            }
        }
        return __d;
    }

    public static ProductServicePrx
    checkedCast(Ice.ObjectPrx __obj, java.util.Map<String, String> __ctx)
    {
        ProductServicePrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (ProductServicePrx)__obj;
            }
            catch(ClassCastException ex)
            {
                if(__obj.ice_isA("::com::ec::service::ProductService", __ctx))
                {
                    ProductServicePrxHelper __h = new ProductServicePrxHelper();
                    __h.__copyFrom(__obj);
                    __d = __h;
                }
            }
        }
        return __d;
    }

    public static ProductServicePrx
    checkedCast(Ice.ObjectPrx __obj, String __facet)
    {
        ProductServicePrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            try
            {
                if(__bb.ice_isA("::com::ec::service::ProductService"))
                {
                    ProductServicePrxHelper __h = new ProductServicePrxHelper();
                    __h.__copyFrom(__bb);
                    __d = __h;
                }
            }
            catch(Ice.FacetNotExistException ex)
            {
            }
        }
        return __d;
    }

    public static ProductServicePrx
    checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map<String, String> __ctx)
    {
        ProductServicePrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            try
            {
                if(__bb.ice_isA("::com::ec::service::ProductService", __ctx))
                {
                    ProductServicePrxHelper __h = new ProductServicePrxHelper();
                    __h.__copyFrom(__bb);
                    __d = __h;
                }
            }
            catch(Ice.FacetNotExistException ex)
            {
            }
        }
        return __d;
    }

    public static ProductServicePrx
    uncheckedCast(Ice.ObjectPrx __obj)
    {
        ProductServicePrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (ProductServicePrx)__obj;
            }
            catch(ClassCastException ex)
            {
                ProductServicePrxHelper __h = new ProductServicePrxHelper();
                __h.__copyFrom(__obj);
                __d = __h;
            }
        }
        return __d;
    }

    public static ProductServicePrx
    uncheckedCast(Ice.ObjectPrx __obj, String __facet)
    {
        ProductServicePrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            ProductServicePrxHelper __h = new ProductServicePrxHelper();
            __h.__copyFrom(__bb);
            __d = __h;
        }
        return __d;
    }

    protected Ice._ObjectDelM
    __createDelegateM()
    {
        return new _ProductServiceDelM();
    }

    protected Ice._ObjectDelD
    __createDelegateD()
    {
        return new _ProductServiceDelD();
    }

    public static void
    __write(IceInternal.BasicStream __os, ProductServicePrx v)
    {
        __os.writeProxy(v);
    }

    public static ProductServicePrx
    __read(IceInternal.BasicStream __is)
    {
        Ice.ObjectPrx proxy = __is.readProxy();
        if(proxy != null)
        {
            ProductServicePrxHelper result = new ProductServicePrxHelper();
            result.__copyFrom(proxy);
            return result;
        }
        return null;
    }
}
